#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
	string s;
	cin >> s;
	string str;
	int count = 0;
	int n = s.size();
	for (int i = n - 1; i >= 0; i--)
	{
		str += s[i];
		count++;
		if (count == 3 && i != 0)
		{
			count = 0;
			str += ',';
		}
	}
    reverse(str.begin(),str.end());
	cout << str << endl;

	return 0;
}